﻿<?php
$sql = "select * from file_management";

$connect = mysql_connect('localhost', 'tass', '114'); // DB 연결
$db_id=mysql_select_db("tass",$connect);

$rs = mysql_query($sql,$connect);
/*
while($reslt = mysql_fetch_array($rs)){
    $seq = $result[seq];
    $english_text = $result[english_text];
    $finish = $result[finish];
    */
while($result = mysql_fetch_array($rs)){
  $searchW = $result[seq];
  $cnt = $result[contests];
  $date = $result[txt_file_name];

    $xmlList.="<word><seq>$searchW</seq><english_text>$cnt</english_text><finish>$date</finish></word>";
}
mysql_free_result($rs);
$fp = fopen("xml_ex.xml","w");
$xmlDoc="<?xml version='1.0' encoding='euc-kr'?> <root>$xmlList</root>";
fputs($fp, $xmlDoc);
fclose($fp);

?>